package com.tangcheng.mybatis.introduction.rbac.mapper;

import com.tangcheng.mybatis.introduction.rbac.domain.bo.LoginNameAndEmailBO;
import com.tangcheng.mybatis.introduction.rbac.domain.entity.SysAccountDO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface SysAccountDOMapper {


    /**
     * foreach in的场景
     *
     * @param idList
     * @return
     */
    List<SysAccountDO> selectByIdList(@Param("idList") List<Long> idList);

    /**
     * 多条件foreach or的场景。多条件，无法用in
     *
     * @param loginNameAndEmailList
     * @return
     */
    List<SysAccountDO> selectByLoginNameAndEmailList(@Param("loginNameAndEmailList") List<LoginNameAndEmailBO> loginNameAndEmailList);

    /**
     * 同时对多个用户呢称进行模糊查询
     *
     * @param searchedNickNameList
     * @return
     */
    List<Long> selectAllLikeMatchedAccountIds(@Param("searchedNickNameList") List<String> searchedNickNameList);

    /**
     * 多条件foreach查询
     *
     * @return
     */
    List<SysAccountDO> selectAll();

    /**
     * 多条件foreach批量插入
     *
     * @return
     */
    int batchInsert(@Param("accountList") List<SysAccountDO> accountList);

    /**
     * 根据Map类型来动态更新记录值
     *
     * @return
     */
    int updateByMap(@Param("mapParams") Map<String, Object> mapParams);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_account
     *
     * @mbg.generated
     */
    int deleteByPrimaryKey(@Param("id") Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_account
     *
     * @mbg.generated
     */
    int insert(SysAccountDO record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_account
     *
     * @mbg.generated
     */
    int insertSelective(SysAccountDO record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_account
     *
     * @mbg.generated
     */
    SysAccountDO selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_account
     *
     * @mbg.generated
     */
    int updateByPrimaryKeySelective(SysAccountDO record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_account
     *
     * @mbg.generated
     */
    int updateByPrimaryKey(SysAccountDO record);
}